import { userManage } from '@/lib/user-manage'
import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './lib/extends'
import components from './components'
import '@/lib/global'
import global from '@/lib/global'
import VueCropper from 'vue-cropper'

Vue.config.productionTip = false

global.init()

Vue.use(ElementUI, { size: 'small' })
Vue.use(components)
Vue.use(VueCropper)

new Vue({
  router,
  store,
  render: h => h(App),
  beforeMount() {
    const userinfo = userManage.getUser()

    console.log('before')
    userManage.handleLogin(this, userinfo)
  },
}).$mount('#app')
